package so.wy.servicecenter.businessbed.dao.rdb.statics;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

@Mapper
@Repository
@Scope("prototype")
public interface StaticsDAO {
    //1、总订单量
    Integer totalOrderCount();
    Integer totalOrderCountByHospital(@Param("hospitalId") Long hospitalId);
    //2、总订单金额，总实际支付金额，总免单金额
    BigDecimal totalOrderFee();
    BigDecimal totalOrderFeeByHospital(@Param("hospitalId") Long hospitalId);
    BigDecimal totalOrderPayFee();
    BigDecimal totalOrderPayFeeByHospital(@Param("hospitalId") Long hospitalId);
    BigDecimal totalOrderFreeFee();
    BigDecimal totalOrderFreeFeeByHospital(@Param("hospitalId") Long hospitalId);
    //3、当前押金池金额 当前总充值用户数
    BigDecimal totalYjFee();
    Integer totalYjUserCount();
    //4、总投放床数量
    Integer totalDeviceCount();
    Integer totalDeviceTfCount();
    Integer totalDeviceTfCountByHospital(@Param("hospitalId") Long hospitalId);
    //5、医院信息（总订单量，订单金额，实际支付金额，总投放床数量）
    List<OrderWdStaticsDO> totalOrderInfoGroupHospital();
    List<DeviceWdStaticsDO> totalDeviceInfoGroupHospital();
    //6、最近一个月总订单量变化趋势
    List<OrderLineStaticsDO> totalDayOrderCountLineLastMonth();
    List<OrderLineStaticsDO> totalDayHospitalOrderCountLineLastMonth(@Param("hospitalId") Long hospitalId);
    //7、充值用户变化趋势
    List<UserLineStaticsDO> totalCzUserCountLine();

    //统计当天的一些信息
    //1、当日订单量
    Integer todayOrderCount();
    Integer todayOrderCountByHospital(@Param("hospitalId") Long hospitalId);
    //2、当日完成订单金额 当日实际支付金额 当日免单金额
    BigDecimal todayOrderFee();
    BigDecimal todayOrderFeeByHospital(@Param("hospitalId") Long hospitalId);
    BigDecimal todayOrderPayFee();
    BigDecimal todayOrderPayFeeByHospital(@Param("hospitalId") Long hospitalId);
    BigDecimal todayOrderFreeFee();
    BigDecimal todayOrderFreeFeeByHospital(@Param("hospitalId") Long hospitalId);
    //3、当日充值用户数 当日充值金额
    Integer todayCzUserCount();
    BigDecimal todayCzAmount();
    //4、医院当日订单信息（总订单量，订单金额，实际支付金额）
    List<OrderWdStaticsDO> todayOrderInfoGroupHospital();

    //医院维度
    //2、各楼层 投放床数量 总订单量
    List<OrderWdStaticsDO> totalOrderInfoGroupFloor(@Param("hospitalId") Long hospitalId);
    List<DeviceWdStaticsDO> totalDeviceInfoGroupFloor(@Param("hospitalId") Long hospitalId);
    //3、各科室 投放床数量 总订单量
    List<OrderWdStaticsDO> totalOrderInfoGroupDepart(@Param("hospitalId") Long hospitalId);
    List<DeviceWdStaticsDO> totalDeviceInfoGroupDepart(@Param("hospitalId") Long hospitalId);
    //4、各楼层 订单量变化趋势
    List<OrderLineStaticsDO> totalDayOrderCountLineLastMonthGroupFloor(@Param("floorId") Long floorId);
    //5、各科室 订单量变化趋势
    List<OrderLineStaticsDO> totalDayOrderCountLineLastMonthGroupDepart(@Param("departId") Long departId);
}
